package edu.zcmu.seckill.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author 唐诗
 * @since 2022-02-22
 */
@Getter
@Setter
@TableName("seckill_order")
public class SeckillOrder implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 订单id
     */
    @TableField("order_id")
    private String orderId;
    /**
     * 秒杀产品id
     */
    @TableField("seckill_id")
    private Integer seckillId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Integer userId;

    /**
     * 产品名称
     */
    @TableField("product_name")
    private String productName;

    /**
     * 支付金额
     */
    @TableField("total_price")
    private BigDecimal totalPrice;

    /**
     * 订单状态/0 待支付/1 已支付/2 订单过期/3 金额异常
     */
    @TableField("order_status")
    private Integer orderStatus;

    /**
     * 订单创建时间
     */
    @TableField("create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 支付时间
     */
    @TableField("update_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date update_time;
}
